﻿using System;
using System.IO;

namespace LabSolutions
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = null;
            using (StreamReader sr = new StreamReader("input.txt"))
            {
                input = sr.ReadToEnd();
            }
            double a = double.Parse(input);
            double z1 = Math.Cos(a) + Math.Cos(2 * a) + Math.Cos(6 * a) + Math.Cos(7 * a);
            double z2 = 4 * Math.Cos(a / 2) * Math.Cos(5d / 2d * a) * Math.Cos(4 * a);
            using (StreamWriter sw = new StreamWriter("output.txt"))
            {
                sw.WriteLine(z1.ToString("0.00000"));
                sw.Write(z2.ToString("0.00000"));
            }            
        }
    }
}
